home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / T / TSiGraphics Preview / B&W Demo Source < prev    next >
Encoding:
Text File  |  1993-02-10  |  1.6 KB  |  60 lines  |  [TEXT/MPS ]

  1.       Program BWDemo
  2.       REAL xdata(200),  ydata(200),  y2data(200)
  3.       INTEGER i,n
  4.       Common /theData/ xdata, ydata, y2data, n
  5.       External CreatePlot
  6.  
  7. !    Initialize TSI Graphics
  8.       Call InitGraphicsPackage()
  9.      
  10. !    Create the data for plotting and pass through common blocks
  11.       n = 200
  12.        do i = 1, n
  13.          xdata(i) = i
  14.          ydata(i) = sin(PI*i/(225-i))
  15.          y2data(i) = sin(PI*i/52) * i * 1.1/real(n)
  16.        end do
  17.      
  18. !    Create a graphics window and hook up our subroutine
  19.       Call DrawInNewWindow(CreatePlot)
  20.  
  21. !    Make the FORTRAN text window small
  22.       Call MoveOutWindow(10,60,250,120)
  23.       write(*,*) 'TSiGraphics Demo'
  24.  
  25. !    Exit and let the FORTRAN menus take over
  26.       End
  27.        
  28.  
  29.       Subroutine CreatePlot
  30. !      Load predefined constants for easier reading of the code
  31.       include 'TSIConstants.fi'
  32.       REAL xdata(200), ydata(200), y2data(200)
  33.       INTEGER n
  34.       Common /theData/ xdata, ydata, y2data,  n
  35.  
  36. !       Initialize the graph window
  37.       Call InitGraphWindow
  38.          
  39. !       Border the current plot region in Black
  40.       Call BorderPlotRegion(Black)
  41.         
  42. !       Change font to Times bold, 12
  43.       Call SetTextStyle('Times', bold, 0, 12)
  44.       
  45. !       Determine the axes automatically, plot the data
  46.       Call AutoAxes(xdata, ydata, n, 0, labelAxis, labelAxis, 0)
  47.       Call LinePlot(xdata, ydata, n, Black)
  48.       Call LinePlot(xdata, y2data, n, Black)
  49.  
  50. !       Change font to Times bold+italic, 18pt and title the plot region 
  51.       Call SetTextStyle('Times', bold+italic, 0, 18)
  52.       Call TitlePlotRegion('Plots of F(Sin(x))')
  53.  
  54. !    Title the plot window
  55.       Call TitleWindow('Line Plot Demo')
  56.  
  57.       Return 
  58.       End 
  59.  
  60.